{% block main-content %}
<div class="modal-header">
  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  <h4 class="modal-title">
    <span> 更新/查看授权 </span><small> {{request.user}}</small>
  </h4>
</div>
<div class="modal-body">

<div class="form-row">
    <label class="modal-title center">系统当前授权:</label>
    <table class="table table-bordered table-condensed nowarp">
        <tr><td>MAC地址:</td><td>{{ lic_mac }}</td></tr>
        <tr><td>系统时间:</td><td>{{ lic_now_time }}</td></tr>
        <tr><td>有效时间:</td><td>{{ lic_valid_time }}</td></tr>
        <tr><td>授权剩余:</td><td>{{ lic_isvalid }}</td></tr>
    </table>
</div>

<div class="form-row">
    <label class="modal-title">服务器信息(申请授权使用):</label>
    <table class="table table-bordered table-condensed nowarp">
        <tr><td>MAC地址:</td><td>{{ sys_mac }}</td></tr>
        <tr><td>C盘卷号:</td><td>{{ sys_cvol }}</td></tr>
        <tr><td>磁盘ID:</td><td>{{ sys_diskid }}</td></tr>
        <tr><td>系统时间:</td><td>{{ sys_systime }}</td></tr>
    </table>
</div>

<form action="{%url 'idcops:update_license'%}" method="POST" enctype="multipart/form-data" role="form" class="form-horizontal">
  <div class="box-body">
    <div class="col-10">
      {% csrf_token %}
      <div class="form-group">
        <label for="new_idc">如需更换授权，请重新上传LICENSE文件:</label>
        <table class="table table-bordered table-condensed nowarp">
            <tr><td>
                {% for field in form.visible_fields %}
                <div>
                <label for="{{ field.id_for_label }}">
                    {{ field.label }}
                </label>
                {{ field }}
                <div>
                    {%if field.field.required%}
                    <span class="text-red">必填</span>
                    {%else%}
                    <span class="text-muted">选填</span>
                    {%endif%}
                    {{ field.help_text|safe}}
                    <div class="text-red">{{ field.errors|safe }}</div>
                </div>
                </div>
                {% endfor %}
            </td></tr>
        </table>
      </div>
    </div>
  </div>
  <div class="box-footer">
    <button type="button" class="btn btn-default btn-sm" type="button" class="close" data-dismiss="modal"
      aria-label="Close">取消</button>
    <div class="pull-right">
      <button type="submit" name="_last" class="btn btn-primary btn-sm margin-r-5">提交</button>
    </div>
  </div>
</form>
</div>
{% endblock main-content %}